package com.studerb.dao.interfaces;

import java.util.List;

import com.studerb.model.Header;
import com.studerb.model.NewsGroup;

public interface IHeaderDao extends DaoInterface<Header> {

	/**
	 * 
	 * 
	 * @param newsGroup
	 * @return count of headers deleted
	 */
	/**
	 * Delete headers for a specific newsgroup based on article number
	 * 
	 * @param newsGroup
	 * @param min
	 *            beginning article for the list to delete; if null, delete all
	 *            less than max
	 * @param max
	 *            ending article number for the list to delete; if null, delete
	 *            all greater than min
	 * @return count of deleted headers
	 */
	int deleteByNewsGroup(NewsGroup newsGroup, Long min, Long max);

	/**
	 * Get newsgroup's headers based on beginning and ending article numbers.
	 * 
	 * @param newsGroup
	 * @param min
	 *            minimum article number; if null, fetch all less than max
	 * @param max
	 *            maximum article number; if null, fetch all greater than min
	 * @return list of headers with article numbers between begin and end
	 *         (inclusive)
	 */
	List<Header> getAllByNewsGroup(NewsGroup newsGroup, Long min, Long max);

	/**
	 * Fetch all headers for a newsgroup that are single part and have article
	 * numbers between min and max inclusive
	 * 
	 * @param newsGroup
	 * @param min
	 *            minimum article number; if null, fetch all less than max
	 * @param max
	 *            maximum article number; if null, fetch all greater than min
	 * @return List of single part headers ordered by article number
	 */
	List<Header> getAllSinglePart(NewsGroup newsGroup, Long min, Long max);

	/**
	 * Save a list of headers for the specified newsgroup
	 * 
	 * @param headers
	 *            list of headers to save
	 * @param newsGroup
	 */
	void saveHeaders(List<Header> headers, NewsGroup newsGroup);
}
